package com.lanqiao.javaparkinglot.dao;

import com.lanqiao.javaparkinglot.entity.Car;
import com.lanqiao.javaparkinglot.entity.Wliu;
import org.apache.ibatis.annotations.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
public interface CarDao {
    //查询
    @Select("select * from car_pay ")
    List<Car> findcar();

    //添加
    @Update("insert into car_pay  (car_eno, car_place, car_number, car_name, car_tele, car_time, car_pay) VALUES (#{car_eno}, #{car_place}, #{car_number}, #{car_name}, #{car_tele}, #{car_time}, #{car_pay})")
    @Transactional
    void addcar(Car car);

    //修改
    @Update("update car_pay set car_eno=#{car_eno},car_place=#{car_place},car_number=#{car_number},car_name=#{car_name},car_tele=#{car_tele},car_time=#{car_time},car_pay=#{car_pay} where car_eno=#{car_eno} ")
    @Transactional
    void updates(Car car);

    //删除
    @Delete("delete from car_pay where car_eno=#{car_eno}")
    void deletecar(Long car_eno);


}
